/**
 * Created by ruiyuan on 15-9-29.
 */

var Schema = mongoose.Schema;

var TaskSchema = new Schema({
    name: String,
    reward: Number,
    deadline: Date,
    user: {type: Schema.Types.ObjectId, ref: 'user'},
    type: {type: String, enum: ['novice']},
    subTask: [
        {
            status: {type: Boolean, default: false},
            title: String,
            desc: String,
            action: String
        }
    ],
    dateCreated: {type: Date, default: Date.now}
});
mongoose.model('user_task', TaskSchema, 'user_task');